<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE root PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core">

	<h:outputText rendered="#{veiculoBean.saveState}">
		<div class="innerTitle">Cadastro Veículo</div>
	</h:outputText>

	<h:outputText rendered="#{veiculoBean.updateState}">
		<div class="innerTitle">Exclusão de Veículo</div>
	</h:outputText>

	<h:inputHidden value="#{veiculoBean.entity.id}" rendered="#{veiculoBean.updateState}" />
	<h:inputHidden value="#{veiculoBean.entity.usuarioId}" rendered="#{veiculoBean.updateState}" />

	<div id="cadastroVeiculo">

	<rich:tabPanel switchType="client">

		<rich:tab label="Excluir Veículo">

			<h:panelGrid columns="2" styleClass="crud" columnClasses="label">

				<h:outputLabel value="Deseja excluir o veículo?" />
					<h:inputText id="nomeVeiculo" value="#{veiculoBean.entity.nome}" maxlength="30" size="30" readonly="true">
				</h:inputText>

				<h:outputLabel value="Informe a justificativa:" />
				<h:inputText id="justificativaVeiculo" value="#{veiculoBean.logUsuario.observacao}" required="true" maxlength="50" size="50">
					<f:validateLength maximum="50" minimum="20" />
					<rich:ajaxValidator event="onblur" />
				</h:inputText>
				<rich:message errorClass="error" for="justificativaVeiculo" />

			</h:panelGrid>

		</rich:tab>

	</rich:tabPanel>

	</div>

	<br />

	<a4j:commandButton value="Excluir" type="submit" action="#{veiculoBean.delete}" styleClass="button" reRender="popup" />
	<a4j:commandButton value="Voltar" type="submit" action="#{veiculoBean.search}" styleClass="button" immediate="true" reRender="popup" />

</ui:composition>